local StoryComposite = require("gameLogic.story.behavior.StoryComposite")
local StoryParallel = class("StoryParallel", StoryComposite)

function StoryParallel:ctor()
    StoryParallel.super.ctor(self)
end

function StoryParallel:_active()
    local count = 0
    for i = 1, #self._children do
        if not self._children[i]:isDone() then
            self._children[i]:tick()
        end
        if self._children[i]:isDone() then
            count = count + 1
        end
    end
    if count == #self._children then
        self:setDone(true)
        printDebug("StoryParallel:_active() Done")
    end
end

return StoryParallel
